<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content=" height=device-height,
			          width=device-width,
			          initial-scale=1.0,
			          minimum-scale=1.0,
			          maximum-scale=1.0
			          user-scalable=no" />
		<script type="text/javascript" src="../js/jquery.min.js" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
				var userId = localStorage.getItem("userId");
				var token = localStorage.getItem("token");
				var ip = localStorage.getItem("ip");
				$.ajax({
					type: 'post', //类型
					url: ip + 'workFlow/list/todo', //请求路径
					contentType: 'application/x-www-form-urlencoded', //默认
					dataType: 'json', //返回数据类型  可以是text：字符串  可以是json：json对象
					data: {
						'userId': userId,
						'token': token,
					}, //数据
					success: function(result) {
						for(var Key in result.rows) {
							var taskcreateTime = result.rows[Key].taskcreateTime;
							var taskname = result.rows[Key].taskname;
							var tkcId = result.rows[Key].taskexecutionId;
							var processInstanceId = result.rows[Key].taskprocessInstanceId;
							var taskId = result.rows[Key].taskid;
							if('调整申请' == taskname){
								var txtcolor = '#FF3030';
							}else{
								var txtcolor = '#00cc99';
							}
							var taskassignee = result.rows[Key].taskassignee;
							var varstitle = result.rows[Key].varstitle;
							var txts = '<tr height="35px" style="background:#ffffcc;" onclick=' + 'getFileFull("' +tkcId + '","'+taskId+'","'+processInstanceId+'"); >';
							txts = txts + '<td style=" font-size: calc(18vw/3.75); border-left: none;border-right:none;border-bottom:none; border-color:#ffffcc;">' + varstitle + '</td></tr>';
							txts = txts + '<tr height="35px" style="background: #ffffcc;" onclick=' + 'getFileFull("' +tkcId + '","'+taskId+'","'+processInstanceId+'");  >';
							txts = txts + '<td style="border: none; border-color:#ffffcc;"> 当前办理：' + taskassignee + '</td></tr>';
							txts = txts + '<tr height="35px" style="background: #ffffcc;" onclick=' + 'getFileFull("' +tkcId + '","'+taskId+'","'+processInstanceId+'");  >';
							txts = txts + '<td style="border: none; border-color:#ffffcc;">申请时间：' + taskcreateTime + '</td></tr>';
							txts = txts + '<tr height="35px" style="background: #ffffcc;" onclick=' + 'getFileFull("' +tkcId + '","'+taskId+'","'+processInstanceId+'"); >';
							txts = txts + '<td style="border-left: none;border-top:none;border-right:none; border-color:#aaa; color:'+txtcolor+';">' + taskname + '</td></tr>';
							$(".pro-ta").append(txts);
						}
					},
					error: function(data) { //若果传过来的数据为空
					}
				});
			});
			getFileFull = function (tkcId,taskId,processInstanceId) {
				localStorage.setItem("tkcId", tkcId);
				localStorage.setItem("taskId", taskId);
				localStorage.setItem("processInstanceId", processInstanceId);
				window.location.href = 'stayMeApprovalDetalis.html';
			}
		</script>
	</head>

	<body>
		<table width="100%" class="pro-ta" border="1" style="border-collapse: collapse; border:none;margin-top: 5%;">
		</table>
	</body>

</html>